package com.hskn.hss.module.tlemergentopera.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hskn.hss.entity.AjaxResult;
import com.hskn.hss.exception.HssException;
import com.hskn.hss.module.tlemergentopera.entity.TlEmergentPlanOperadetails;
import com.hskn.hss.module.tlemergentopera.mapper.TlEmergentPlanOperadetailsMapper;
import com.hskn.hss.module.tlemergentopera.service.ITlEmergentPlanOperadetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author hskn
 * @since 2021-05-18
 */
@Service
public class TlEmergentPlanOperadetailsServiceImpl extends ServiceImpl<TlEmergentPlanOperadetailsMapper, TlEmergentPlanOperadetails> implements ITlEmergentPlanOperadetailsService {
    @Autowired
    TlEmergentPlanOperadetailsMapper tlEmergentPlanOperadetailsMapper;

    @Override
    public AjaxResult insert(TlEmergentPlanOperadetails tlEmergentPlanOperadetails) throws HssException {
        tlEmergentPlanOperadetailsMapper.insert(tlEmergentPlanOperadetails);
        return AjaxResult.success("操作成功");
    }

    @Override
    public AjaxResult deletebyid(String planid) throws HssException {
        Map map = new HashMap<>();
        map.put("planid", planid);
        tlEmergentPlanOperadetailsMapper.deleteByMap(map);
        return AjaxResult.success("操作成功");
    }
}
